package com.vitabuybuy.tv.ui.mine.setting

import android.os.Bundle
import com.vitabuybuy.tv.R
import com.vitabuybuy.tv.databinding.ActivityHelpcenterBinding
import com.library.common.base.BaseActivity
import com.library.common.base.MessageModel
import com.vitabuybuy.tv.ui.WebViewActivity
import com.vitabuybuy.tv.ui.mine.setting.viewmodel.HelpCenterViewModel

class HelpCenterActivity : BaseActivity<HelpCenterViewModel, ActivityHelpcenterBinding>() {
    override val isUseBaseTitleBar: Boolean
        get() = true
    override val layoutId: Int
        get() = R.layout.activity_helpcenter

    override fun initView(savedInstanceState: Bundle?) {
        setTitle(getString(R.string.help_center))
        mBinding.viewModel = viewModel
    }

    override fun observeData() {
        viewModel.getData()
    }
    override fun handleEvent(msg: MessageModel) {
        when(msg.code){
            1->{
                WebViewActivity.openActivity(mContext,"","",msg.arg1)
            }
        }
    }

    companion object {
        fun openActivity(mContext: BaseActivity<*, *>) {
            mContext.startActivity(null, HelpCenterActivity::class.java)
        }
    }
}
